package com.ddd.domain.model.product;

import com.ddd.domain.share.ValueObject;

import java.time.LocalDate;

public class ProductValueObject implements ValueObject<ProductValueObject> {

    /**
     * 商品id
     */
    private String skuId;
    /**
     * 通用名
     */
    private String commonName;
    /**
     * 批号
     */
    private String batchNo;
    /**
     * 生产日期
     */
    private LocalDate productionDate;

    /**
     * 有效期至
     */
    private LocalDate expiryDate;
    /**
     * 保质期天数
     */
    private int day;

    public ProductValueObject(String skuId, String commonName, String batchNo, LocalDate productionDate, LocalDate expiryDate) {
        this.skuId = skuId;
        this.commonName = commonName;
        this.batchNo = batchNo;
        this.productionDate = productionDate;
        this.expiryDate = expiryDate;
        //todo 计算保质期天数，（在value object计算）
        this.day = 0;
    }

    @Override
    public boolean sameValueAs(ProductValueObject other) {
        return true;
    }
}
